from rest_framework import serializers


from .models import SKU

class GoodsListSerializer(serializers.ModelSerializer):

    class Meta:
        model = SKU
        fields = ['id','name','price','default_image_url','comments']

from goods.search_indexes import SKUIndex
from drf_haystack.serializers import HaystackSerializer
class GoodsSearchSerializer(HaystackSerializer):
    class Meta:
        index_classes = [SKUIndex]
        fields = ['text','id','name','price','default_image_url','comments']